//
//  YDDUser.m
//  YaDiuDiu
//
//  Created by Zephyr on 2017/9/19.
//  Copyright © 2017年 jy. All rights reserved.
//

#import "YDDUser.h"

@implementation YDDUser

+ (instancetype)userWithDict:(NSDictionary *)dict {
    
    YDDUser *yUser = [YDDUser new];
    [yUser setValuesForKeysWithDictionary:dict];
    return yUser;
    
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
    if ([key isEqualToString:@"is_educationcerti"]) {
        if ([value intValue] == 2) {
            _isEducationCerti = YES;
        } else {
            _isEducationCerti = NO;
        }
    } else if ([key isEqualToString:@"merchanttype"]) {
        _merchantType = [value integerValue];
    } else if ([key isEqualToString:@"toexamine"]) {
        _merchantCertifyType = [value integerValue];
    }
    
}

- (void)setAvatar:(NSString *)avatar {
    
    _avatar = [@"http://ydd.xtangguo.com" stringByAppendingString:avatar];
    
}

@end
